<?xml version="1.0" encoding="utf-8"?>

<!--
    Document   : searchresult.xsl
    Created on : 18 March 2009, 18:28
    Author     : Vincent.Sun
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>

    <!-- TODO customize transformation rules 
         syntax recommendation http://www.w3.org/TR/xslt 
    -->
    <xsl:template match="/result/flightsResults">
        <!-- this page is converted from xml -->
        <html>
            <head>
                <title>Flights Info</title>
            </head>
            <body>
                <xsl:for-each select="item">
                    <table>
                        <tr><td><h2>From <xsl:value-of select="departure"/> To <xsl:value-of select="arrival"/></h2></td></tr>
                        <tr>
                        <xsl:for-each select="flights/item">
                            <td><h3><xsl:value-of select="travelDate"/>
                            <br />
                            <xsl:if test="price != -1.0">
                            <xsl:value-of select="price" /></xsl:if>
                            </h3></td>
                        </xsl:for-each>
                        </tr>
                    </table>
                </xsl:for-each>
            </body>
        </html>
    </xsl:template>

</xsl:stylesheet>
